from re import X


class Vector:
    def __init__(self, x, y, z) -> None:
        self.x = x
        self.y = y 
        self.z = z
    
    def __str__(self) -> str:
        return f'{self.x}{self.y}{self.z},{self.__dict__}'

    def __add__(self, other):
        if type(other) == self.__class__:
            return Vector(self.x + other.x,self.y + other.y, self.z + other.z)
        else:
            raise Exception('格式出现错误！')
    
    def __mul__(self, other):
        if type(other) == self.__class__:
            return Vector(self.x * other.x,self.y * other.y, self.z * other.z)
        else:
            raise Exception('格式出现错误！')
v1 = Vector(1,2,1)
v2 = Vector(1,2,1)
print(v1)
print(v2)

print(
    type(v1) == v2.__class__
)

print(
    v1 + v2
)
